package com.atguigu.jxc.controller;
import com.atguigu.jxc.entity.bejson.pojo.JsonRootBean;
import com.atguigu.jxc.service.GoodsTypeService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RequestMapping("/goodsType")
@RestController
public class GoodsTypeController {
    @Autowired
    GoodsTypeService goodsTypeService;
    @PostMapping("/loadGoodsType")
    private String loadGoodsType(){
      List<JsonRootBean> jsonRootBeanList = goodsTypeService.loadGoodsType();
        String s = JSONObject.toJSONString(jsonRootBeanList);
        return s;
    }
}
